Incorporating today's flash memory devices, such as NAND flash memory, to a hard disk system can offer many performance advantages, because they can help avoid trips to the rotating storage. If host read data resides in the flash memory, the data can be returned quickly from the flash memory, instead of the rotating storage. In addition, host write data can be quickly committed to the flash memory and acknowledged to the host, as the flash memory is itself persistent storage. However, the performance advantage of the flash memory is only available if the host read data resides in flash memory or if there are free blocks to accept the host write data. Thus, techniques for managing the data in flash memory become important in order to realize the performance advantage. When the management technique operates in a manner that does not utilize the full capacity of the flash memory, then some of the performance advantage that is possible is not realized.
An important aspect of managing flash memory includes observing the operational characteristics of this type of memory. A flash memory device is organized as sectors of a certain size, such as 512, 2048, or 4096 or more bytes, for reading operations and writing operations, but as blocks, consisting of 32 or 64 sectors, for erasing operations, which are necessary before a write operation in the block is possible. In addition, in a flash memory device there is a limit on the number of erase and write cycles (also sometimes referred to as program cycles). Thus, management of the flash memory device should attempt to keep often-accessed data in the flash memory device, provide erased blocks to accept new write data from a host using the disk system, and to minimize the number of erase and write cycles.